package com.zfl.anno;

import com.zfl.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.FIELD;

@Documented//标识State可以抽取到帮助文档
@Target({FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {StateValidation.class})
public @interface State {
    //校验失败后的提示
    String message() default "state参数的值只能是已发布或者是草稿";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
